/**
 * 
 */
package complexnumber;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * @author becarios
 * 
 */
public class ComplexNumberTest {
	private ComplexNumber cOneZero = new ComplexNumber(1, 0);;
	private ComplexNumber cZeroOne = new ComplexNumber(0, 1);
	private ComplexNumber cOneOne = new ComplexNumber(1, 1);

	/**
	 * Test method for
	 * {@link complexnumber.ComplexNumber#ComplexNumber(double, double)}.
	 */
	@Test
	public void testComplexNumber() {
		System.out.println("ComplexNumber");
		assertNotNull(cOneZero);
		assertNotNull(cZeroOne);
		assertNotNull(cOneOne);
		// fail("Not yet implemented");
	}

	/**
	 * Test method for {@link complexnumber.ComplexNumber#getReal()}.
	 */

	@Test
	public void testGetReal() {
		System.out.println("getReal");
		double expResult = 0.0;
		double result = cZeroOne.getReal();
		assertEquals(expResult, result, 0.0);
	}

	/**
	 * Test method for {@link complexnumber.ComplexNumber#getImaginary()}.
	 */
	@Test
	public void testGetImaginary() {
		System.out.println("getImaginary");
		double expResult = 0.0;
		double result = cOneZero.getImaginary();
		assertEquals(expResult, result, 0.0);
	}

	/**
	 * Test method for
	 * {@link complexnumber.ComplexNumber#add(complexnumber.ComplexNumber)}.
	 */
	@Test
	public void testAdd() {
		System.out.println("add");
		ComplexNumber result = cZeroOne.add(cOneZero);
		assertEquals(cOneOne, result);

	}

	/**
	 * Test method for
	 * {@link complexnumber.ComplexNumber#multiply(complexnumber.ComplexNumber)}
	 * .
	 */
	@Test
	public void testMultiply() {
		System.out.println("multiply");
		ComplexNumber result = cZeroOne.multiply(cOneZero);
		assertEquals(cZeroOne, result);

	}

	/**
	 * Test method for
	 * {@link complexnumber.ComplexNumber#equals(java.lang.Object)}.
	 */
	@Test
	public void testEqualsObject() {
		System.out.println("equals false");
		boolean expResult = false;
		boolean result = cZeroOne.equals(cOneZero);
		assertEquals(expResult, result);

		System.out.println("equals true");
		expResult = true;
		result = cZeroOne.equals(cZeroOne);
		assertEquals(expResult, result);
	}

}